<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/include/helib/CModulus.h Source File</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d0c4ae63660968bf6b1c77a1e8aecf95.html">helib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">CModulus.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_c_modulus_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* Copyright (C) 2012-2020 IBM Corp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This program is Licensed under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * with the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * limitations under the License. See accompanying LICENSE file.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef HELIB_CMODULUS_H</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#define HELIB_CMODULUS_H</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_numb_th_8h.html">helib/NumbTh.h</a>&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_p_algebra_8h.html">helib/PAlgebra.h</a>&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="bluestein_8h.html">helib/bluestein.h</a>&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="cloned_ptr_8h.html">helib/clonedPtr.h</a>&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehelib.html">helib</a> {</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html">   42</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_cmodulus.html">Cmodulus</a></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;{</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  <span class="keywordtype">long</span> q;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  NTL::mulmod_t qinv;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  NTL::zz_pContext context;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_p_algebra.html">PAlgebra</a>* zMStar;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  <span class="keywordtype">long</span> m_inv;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  <span class="keywordtype">long</span> root;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  <span class="keywordtype">long</span> rInv;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="comment">// tables for forward FFT</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  copied_ptr&lt;NTL::zz_pX&gt; powers;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  NTL::Vec&lt;NTL::mulmod_precon_t&gt; powers_aux;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  copied_ptr&lt;NTL::fftRep&gt; Rb;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="comment">// tables for backward FFT</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  copied_ptr&lt;NTL::zz_pX&gt; ipowers;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  NTL::Vec&lt;NTL::mulmod_precon_t&gt; ipowers_aux;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  copied_ptr&lt;NTL::fftRep&gt; iRb;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="comment">// PhimX modulo q, for faster division w/ remainder</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  copied_ptr&lt;zz_pXModulus1&gt; phimx;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <span class="comment">// Allocate memory and compute roots</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keywordtype">void</span> privateInit(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_p_algebra.html">PAlgebra</a>&amp;, <span class="keywordtype">long</span> rt);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">#ifdef HELIB_OPENCL</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  SmartPtr&lt;AltFFTPrimeInfo&gt; altFFTInfo;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  <span class="comment">// We need to allow copying...the underlying object</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  <span class="comment">// is immutable</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  <span class="comment">// Destructor and constructors</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#afbc988779d001451f2c8835d83774cd2">   89</a></span>&#160;  <a class="code" href="classhelib_1_1_cmodulus.html#afbc988779d001451f2c8835d83774cd2">Cmodulus</a>() {}</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#a42dedd9c230aa0c30a8e6174f39a8f96">   91</a></span>&#160;  <a class="code" href="classhelib_1_1_cmodulus.html#a42dedd9c230aa0c30a8e6174f39a8f96">Cmodulus</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_cmodulus.html">Cmodulus</a>&amp; other) { *<span class="keyword">this</span> = other; }</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  <a class="code" href="classhelib_1_1_cmodulus.html#afbc988779d001451f2c8835d83774cd2">Cmodulus</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_p_algebra.html">PAlgebra</a>&amp; zms, <span class="keywordtype">long</span> qq, <span class="keywordtype">long</span> rt);</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <a class="code" href="classhelib_1_1_cmodulus.html">Cmodulus</a>&amp; <a class="code" href="classhelib_1_1_cmodulus.html#a8974d70406beb965178205865708a9fa">operator=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_cmodulus.html">Cmodulus</a>&amp; other);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  <span class="comment">// utility methods</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#af389a07cb998891d1fe49bcbda677055">  105</a></span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_p_algebra.html">PAlgebra</a>&amp; <a class="code" href="classhelib_1_1_cmodulus.html#af389a07cb998891d1fe49bcbda677055">getZMStar</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *zMStar; }</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#ab8b176aec7babca5bb5037e641045e20">  106</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_cmodulus.html#ab8b176aec7babca5bb5037e641045e20">getM</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> zMStar-&gt;<a class="code" href="classhelib_1_1_p_algebra.html#a6852047dd695a0b1ae1a5ea03c3b2c53">getM</a>(); }</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#a168e5658960ea94da093f26c398c3244">  107</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_cmodulus.html#a168e5658960ea94da093f26c398c3244">getPhiM</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> zMStar-&gt;<a class="code" href="classhelib_1_1_p_algebra.html#a4422e1911052282a6881fa97ae5061dd">getPhiM</a>(); }</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#a48c891eb43ab3090b6374d9542f4b132">  108</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_cmodulus.html#a48c891eb43ab3090b6374d9542f4b132">getQ</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> q; }</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#aef48dd4ed896cdb3e04d86127a17d7c7">  109</a></span>&#160;  NTL::mulmod_t <a class="code" href="classhelib_1_1_cmodulus.html#aef48dd4ed896cdb3e04d86127a17d7c7">getQInv</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> qinv; }</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#aa374c727756eb1aa2f9969c170f092dc">  110</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_cmodulus.html#aa374c727756eb1aa2f9969c170f092dc">getRoot</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> root; }</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#a36c934bf2a15b4b33c908fb716d136bc">  111</a></span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1zz__p_x_modulus1.html">zz_pXModulus1</a>&amp; <a class="code" href="classhelib_1_1_cmodulus.html#a36c934bf2a15b4b33c908fb716d136bc">getPhimX</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *phimx; }</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classhelib_1_1_cmodulus.html#a9ddcc336786feec724a045fa76a8ec82">  114</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_cmodulus.html#a9ddcc336786feec724a045fa76a8ec82">restoreModulus</a>()<span class="keyword"> const </span>{ context.restore(); }</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  <span class="comment">// FFT routines</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  <span class="comment">// sets zp context internally</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  <span class="comment">// y = FFT(x)</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_cmodulus.html#a8c8738c875fcb72a9423a0e48879ed39">FFT</a>(NTL::vec_long&amp; y, <span class="keyword">const</span> NTL::ZZX&amp; x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="comment">// y = FFT(x)</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_cmodulus.html#a8c8738c875fcb72a9423a0e48879ed39">FFT</a>(NTL::vec_long&amp; y, <span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  <span class="comment">// auxiliary routine used by above two routines</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_cmodulus.html#a6fa180f90681682ebaaec54e356e2ff4">FFT_aux</a>(NTL::vec_long&amp; y, NTL::zz_pX&amp; tmp) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  <span class="comment">// expects zp context to be set externally</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <span class="comment">// x = FFT^{-1}(y)</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_cmodulus.html#a62cf7fc60c4f8d106b0dd73cede44f5f">iFFT</a>(NTL::zz_pX&amp; x, <span class="keyword">const</span> NTL::vec_long&amp; y) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="comment">// returns thread-local scratch space</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  <span class="comment">// DIRT: this zz_pX is used for several zz_p moduli,</span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;  <span class="comment">// which is not officially sanctioned by NTL, but should be OK.</span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  <span class="keyword">static</span> NTL::zz_pX&amp; <a class="code" href="classhelib_1_1_cmodulus.html#aafe116f6127fdf02e971b3fbf003a6ed">getScratch_zz_pX</a>();</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <span class="keyword">static</span> NTL::Vec&lt;long&gt;&amp; <a class="code" href="classhelib_1_1_cmodulus.html#acbe3c6b5fa0f9664a8893641c167cbcb">getScratch_vec_long</a>();</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  <span class="comment">// returns thread-local scratch space</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <span class="comment">// DIRT: this use a couple of internal, undocumented</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  <span class="comment">// NTL interfaces</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;  <span class="keyword">static</span> NTL::fftRep&amp; <a class="code" href="classhelib_1_1_cmodulus.html#a04b35350474f80a9aef3c39ad771421d">getScratch_fftRep</a>(<span class="keywordtype">long</span> k);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;};</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160; </div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;} <span class="comment">// namespace helib</span></div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="preprocessor">#endif // ifndef HELIB_CMODULUS_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasshelib_1_1_p_algebra_html_a6852047dd695a0b1ae1a5ea03c3b2c53"><div class="ttname"><a href="classhelib_1_1_p_algebra.html#a6852047dd695a0b1ae1a5ea03c3b2c53">helib::PAlgebra::getM</a></div><div class="ttdeci">long getM() const</div><div class="ttdoc">Returns m.</div><div class="ttdef"><b>Definition:</b> PAlgebra.h:162</div></div>
<div class="ttc" id="anamespacehelib_html_a4d6002f36f1a61982fded09adf1331ca"><div class="ttname"><a href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">helib::zzX</a></div><div class="ttdeci">NTL::Vec&lt; long &gt; zzX</div><div class="ttdef"><b>Definition:</b> zzX.h:24</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a6fa180f90681682ebaaec54e356e2ff4"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a6fa180f90681682ebaaec54e356e2ff4">helib::Cmodulus::FFT_aux</a></div><div class="ttdeci">void FFT_aux(NTL::vec_long &amp;y, NTL::zz_pX &amp;tmp) const</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:345</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a62cf7fc60c4f8d106b0dd73cede44f5f"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a62cf7fc60c4f8d106b0dd73cede44f5f">helib::Cmodulus::iFFT</a></div><div class="ttdeci">void iFFT(NTL::zz_pX &amp;x, const NTL::vec_long &amp;y) const</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:450</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a42dedd9c230aa0c30a8e6174f39a8f96"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a42dedd9c230aa0c30a8e6174f39a8f96">helib::Cmodulus::Cmodulus</a></div><div class="ttdeci">Cmodulus(const Cmodulus &amp;other)</div><div class="ttdef"><b>Definition:</b> CModulus.h:91</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a9ddcc336786feec724a045fa76a8ec82"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a9ddcc336786feec724a045fa76a8ec82">helib::Cmodulus::restoreModulus</a></div><div class="ttdeci">void restoreModulus() const</div><div class="ttdoc">Restore NTL's current modulus.</div><div class="ttdef"><b>Definition:</b> CModulus.h:114</div></div>
<div class="ttc" id="a_numb_th_8h_html"><div class="ttname"><a href="_numb_th_8h.html">NumbTh.h</a></div><div class="ttdoc">Miscellaneous utility functions.</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a04b35350474f80a9aef3c39ad771421d"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a04b35350474f80a9aef3c39ad771421d">helib::Cmodulus::getScratch_fftRep</a></div><div class="ttdeci">static NTL::fftRep &amp; getScratch_fftRep(long k)</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:540</div></div>
<div class="ttc" id="aclasshelib_1_1_p_algebra_html"><div class="ttname"><a href="classhelib_1_1_p_algebra.html">helib::PAlgebra</a></div><div class="ttdoc">The structure of (Z/mZ)* /(p)</div><div class="ttdef"><b>Definition:</b> PAlgebra.h:77</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a36c934bf2a15b4b33c908fb716d136bc"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a36c934bf2a15b4b33c908fb716d136bc">helib::Cmodulus::getPhimX</a></div><div class="ttdeci">const zz_pXModulus1 &amp; getPhimX() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:111</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_acbe3c6b5fa0f9664a8893641c167cbcb"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#acbe3c6b5fa0f9664a8893641c167cbcb">helib::Cmodulus::getScratch_vec_long</a></div><div class="ttdeci">static NTL::Vec&lt; long &gt; &amp; getScratch_vec_long()</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:534</div></div>
<div class="ttc" id="a_p_algebra_8h_html"><div class="ttname"><a href="_p_algebra_8h.html">PAlgebra.h</a></div><div class="ttdoc">Declarations of the classes PAlgebra.</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html"><div class="ttname"><a href="classhelib_1_1_cmodulus.html">helib::Cmodulus</a></div><div class="ttdoc">Provides FFT and iFFT routines modulo a single-precision prime.</div><div class="ttdef"><b>Definition:</b> CModulus.h:43</div></div>
<div class="ttc" id="aclasshelib_1_1zz__p_x_modulus1_html"><div class="ttname"><a href="classhelib_1_1zz__p_x_modulus1.html">helib::zz_pXModulus1</a></div><div class="ttdoc">Auxiliary classes to facilitate faster reduction mod Phi_m(X) when the input has degree less than m.</div><div class="ttdef"><b>Definition:</b> NumbTh.h:750</div></div>
<div class="ttc" id="anamespacehelib_html"><div class="ttname"><a href="namespacehelib.html">helib</a></div><div class="ttdef"><b>Definition:</b> apiAttributes.h:21</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a48c891eb43ab3090b6374d9542f4b132"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a48c891eb43ab3090b6374d9542f4b132">helib::Cmodulus::getQ</a></div><div class="ttdeci">long getQ() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:108</div></div>
<div class="ttc" id="abluestein_8h_html"><div class="ttname"><a href="bluestein_8h.html">bluestein.h</a></div><div class="ttdoc">declaration of BluesteinFFT(x, n, root, powers, powers_aux, Rb):</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_afbc988779d001451f2c8835d83774cd2"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#afbc988779d001451f2c8835d83774cd2">helib::Cmodulus::Cmodulus</a></div><div class="ttdeci">Cmodulus()</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> CModulus.h:89</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a168e5658960ea94da093f26c398c3244"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a168e5658960ea94da093f26c398c3244">helib::Cmodulus::getPhiM</a></div><div class="ttdeci">unsigned long getPhiM() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:107</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a8c8738c875fcb72a9423a0e48879ed39"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a8c8738c875fcb72a9423a0e48879ed39">helib::Cmodulus::FFT</a></div><div class="ttdeci">void FFT(NTL::vec_long &amp;y, const NTL::ZZX &amp;x) const</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:418</div></div>
<div class="ttc" id="aclasshelib_1_1_p_algebra_html_a4422e1911052282a6881fa97ae5061dd"><div class="ttname"><a href="classhelib_1_1_p_algebra.html#a4422e1911052282a6881fa97ae5061dd">helib::PAlgebra::getPhiM</a></div><div class="ttdeci">long getPhiM() const</div><div class="ttdoc">Returns phi(m)</div><div class="ttdef"><b>Definition:</b> PAlgebra.h:168</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_aef48dd4ed896cdb3e04d86127a17d7c7"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#aef48dd4ed896cdb3e04d86127a17d7c7">helib::Cmodulus::getQInv</a></div><div class="ttdeci">NTL::mulmod_t getQInv() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:109</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_af389a07cb998891d1fe49bcbda677055"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#af389a07cb998891d1fe49bcbda677055">helib::Cmodulus::getZMStar</a></div><div class="ttdeci">const PAlgebra &amp; getZMStar() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:105</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_a8974d70406beb965178205865708a9fa"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#a8974d70406beb965178205865708a9fa">helib::Cmodulus::operator=</a></div><div class="ttdeci">Cmodulus &amp; operator=(const Cmodulus &amp;other)</div><div class="ttdoc">Copy assignment operator.</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:168</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_ab8b176aec7babca5bb5037e641045e20"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#ab8b176aec7babca5bb5037e641045e20">helib::Cmodulus::getM</a></div><div class="ttdeci">unsigned long getM() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:106</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_aa374c727756eb1aa2f9969c170f092dc"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#aa374c727756eb1aa2f9969c170f092dc">helib::Cmodulus::getRoot</a></div><div class="ttdeci">long getRoot() const</div><div class="ttdef"><b>Definition:</b> CModulus.h:110</div></div>
<div class="ttc" id="acloned_ptr_8h_html"><div class="ttname"><a href="cloned_ptr_8h.html">clonedPtr.h</a></div><div class="ttdoc">Implementation of smart pointers with &quot;deep cloning&quot; semantics.</div></div>
<div class="ttc" id="aclasshelib_1_1_cmodulus_html_aafe116f6127fdf02e971b3fbf003a6ed"><div class="ttname"><a href="classhelib_1_1_cmodulus.html#aafe116f6127fdf02e971b3fbf003a6ed">helib::Cmodulus::getScratch_zz_pX</a></div><div class="ttdeci">static NTL::zz_pX &amp; getScratch_zz_pX()</div><div class="ttdef"><b>Definition:</b> CModulus.cpp:528</div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
